package com.example.chaptor3;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button button = findViewById(R.id.button);
        button.setOnClickListener(new View.OnClickListener(){//OnClickListener
            public void onClick(View v){
                Intent intent = new Intent();
                intent.setClass(MainActivity.this,TextViewActivity.class);
            }
        });
        TextView tv_background = findViewById(R.id.tv_hello);
        tv_background.setBackgroundResource(R.color.purple_200);
    }
}